#include <stdio.h>
#include <stdbool.h>
bool search(const int a[], int n, int key);
int main(void)
{
    int a[10] = {1, 2, 3, 4, 5, 6, 7};
    printf("%d\n", search(a, 10, 2));
    printf("%d\n", search(a, 10, 0));
    printf("%d\n", search(a, 10, 9));
    return 0;
}
bool search(const int a[], int n, int key) {
    for (const int *p = a; p < a + n; p++)
        if (*p == key)
            return true;
    return false;
}
